<template>
   
      <div class="dy">
    <!-- 最受期待 -->
    <div class="zsqd">
      <p class="zj">近期最受期待</p>
      <div class="qdlist">
        <ul class="qdul">
          <li v-for="item in zsqdList" :key="item.id" class="qdli">
            <img :src="item.img" alt="" />
            <p class="qdwish">{{ item.wish }}人想看</p>
            <p class="qdnm">{{ item.nm }}</p>
            <p class="qda">{{ item.comingTitle[0] }}</p>
          </li>
        </ul>
      </div>
    </div>
    <!-- 待映列表 -->
    <div class="daiyin">
      <ul class="list">
        <li v-for="(value, key) in daiyingList" :key="key">
          <div>{{ key }}</div>
          <ul>
            <li v-for="item in value" :key="item.id">
              <div class="bc">
              <div>
                <img :src="item.img" alt="" />
              </div>
              <div class="ba">
                <p class="bd">{{ item.nm }}</p>
                <p class="be">{{ item.wish }}人想看</p>
                <p class="bf">{{ item.star }}</p>
                <p class="bg">{{ item.rt }}上映</p>
              </div>
              <div class="bi">预售</div>
              </div>
              
            </li>
          </ul>
        </li>
      </ul>
    </div>
  </div>
        <!-- <ul class="daiying">
           <div>近期最受期待
             
           </div>

            <li v-for="item in daiying" :key="item.id" >
                 <span class="coming">
                    <div>{{item.comingTitle}}</div>
                 </span>
                 <div class="item">
                      <div class="item_img">
                            <img :src="item.img"/>
                      </div>
                      <div class="item_text">
                          <div class="nm">{{item.nm}}</div>
                          <div>观众评<span class="sc">{{item.sc}}</span></div>
                          <div>主演{{item.star}}</div>
                          <div>{{item.showInfo}}</div>
                      </div>
                      <div class="item_btn">
                          <div v-if="item.prsShow" class="btn ysbtn">预售</div>
                          <div v-else class="btn gpbtn">想看</div>
                      </div>
                 </div>
                
            </li>
        </ul>
    </div> -->
</template>

<script>
import axios from "axios";

//引入最受期待组件
// import pidai from "@/components/wait/pidai";

export default {
    name:"wait",
    data: function () {
    return {
      daiyingList: [],
      zsqdList: [],
    //   pidai:"",//接收最受期待组件字符串数据
    };
  },
  //注册
    // components: {
    //     pidai,
    // },

    mounted () {
        axios.get("/ajax/comingList?ci=30&token=uxYB5q3yS4sD6xoCU1d5V5xEqkwAAAAA6g0AAFziAXwhVjP2QJca-0F-UpwZ-sJ7klWzyakYKREBxSnlzA59lY01wazJo694a_rysw&limit=10&optimus_uuid=9301B8F0D8A111EBB376757321755EB7A2F821BBA2B047FE86EE9833C24FC202&optimus_risk_level=71&optimus_code=10").then((res) =>{
            console.log(res);
            var daiyingList = res.data.coming;
        var daiying = {};
        daiyingList.forEach((item) => {
          item.img = item.img.replace("w.h", "64.90");
          if (daiying[item.comingTitle]) {
            daiying[item.comingTitle].push(item);
          } else {
            daiying[item.comingTitle] = [];
            daiying[item.comingTitle].push(item);
          }
        });
        this.daiyingList = daiying;
      });
    axios
      .get(
        "/ajax/mostExpected?ci=30&limit=10&offset=0&token=&optimus_uuid=EE2E3CD0C90111EB994EDD996AAFB489066321E8E0F94AC7B29985642B8BE655&optimus_risk_level=71&optimus_code=10"
      )
      .then((res) => {
        // console.log(res, 50);
        this.zsqdList = res.data.coming;
        this.zsqdList.forEach((item) => {
          item.img = item.img.replace("w.h", "85.115");
          item.comingTitle = item.comingTitle.split(" ");
            })
        });
        //获取最受期待数据
        // axios.get("").then( (res) =>{
        //     console.log(48,res);
        //     this.haoping = res.data;
        // });
    }
}
</script>

<style scoped>
.dy{margin-left: 10px;}
.zsqd {
  margin-bottom: 10px;
}
.zj {
  font-size: 14px;
  margin-bottom: 12px;
}
.qdul {
  display: flex;
  overflow: auto;
}
.qdul::-webkit-scrollbar {
  display: none;
}
.qdli {
  /* width: 85px;
  height: 115px; */
  position: relative;
  margin-bottom: 6px;
  margin-right: 10px;
}
.qdli:last-child {
  margin-right: 0;
}
.qdli > img {
  width: 85px;
  height: 115px;
}
.qdwish {
  position: absolute;
  left: 4px;
  bottom: 40px;
  color: #faaf00;
  font-size: 11px;
  font-weight: 600;
}
.qdnm {
  font-size: 13px;
  width: 85px;
  font-weight: 700;
  color: #222;
  margin-bottom: 3px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.qda {
  font-size: 12px;
  color: #999;
}

.ba{
  margin-left: 20px;
}
.bc{
  display: flex;
 
}

.bd{
  width:150px;
  font-size: 17px;
    color: #333;
    font-weight: 700;
    padding-right: 5px;
    flex-shrink: 1;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}
.be{
  color: #faaf00;
    font-size: 15px;
    font-weight: 600;
}
.bf,.bg{
  color: #666;
   font-size: 13px;
}
.bi{
  background-color: #3c9fe6;
  width: 47px;
    height: 27px;
    line-height: 28px;
    text-align: center;
    box-sizing: border-box;
    margin-left: 60px;
    color: #fff;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 12px;
    cursor: pointer;
}
</style>